<?php
$mysql_server_name='localhost'; 

$mysql_username='root'; 
 
$mysql_password=''; 
 
$mysql_database='test';

$conn=mysqli_connect($mysql_server_name,$mysql_username,$mysql_password,$mysql_database='test');

    if($conn){
        echo"ok";
    }else{
        echo"error";    
    }

 mysqli_query($conn,"SELECT student id,age FROM student WHERE age between 18 and 22");
 //查询年龄在18-22之间的学生
mysqli_query($conn,"UPDATE  'student' set student id='081' where student id='001'"); 
//将学生“001”的学号改成“081”
 $id=mysqli_query($conn,"SELECT student id from course where course numer='5'");
 mysqli_query ($conn,"SELECT name from student where student id=$id");
//查询选修了课程号为“5”课程的学生学号和姓名
 mysqli_query($conn,"SELECT * from option order by score desc"); 
 //	按照成绩倒序（在选课表中）
 mysqli_query($conn,"DELETE * from student where student id='002'"); 
//删除学号为“002”的学生 
 mysqli_query($conn,"ALTER TABLE student add local VARCHAR(12) NOT NULL after  birthday");
//在学生表中增加“地址字段”，类型为字符型
 mysqli_query($conn,"DROP TABLE option");
//删除“选课”这张表
$idi=mysqli_query($conn,"SELECT student id from student where name='李%'");
mysqli_query($conn,"SELECT grade from option where student id=$idi");
//查询所有姓“李”的学生的成绩

?>